<script type="text/javascript">

function loadPageData(url){
	$.post(url,function(data){
		document.getElementById("brand-list").innerHTML=data;
	});
}

function loadData(id){
	$.post("${base}/brands.html?id="+id,function(data){
		document.getElementById("brand-list").innerHTML=data;
	});
}
function loadAllData(){
	$.post("${base}/brands.html",function(data){
		document.getElementById("brand-list").innerHTML=data;
	});
}

var dropDownMenu = 
{
    tag:0,
    knowledgeBase:[
    
    <#if cates??>
    <#list cates as cate>
    
        {
            'name':'${((cate.name)?trim)!'undefine'}',
            'list':[
            	<#list cate.children as child>
                ['${((child.name)?trim)!'undefine'}',"javascript:loadData('${(child.id)!''}');"],
                </#list>
            ]
        },
        
    </#list>
    </#if>
    
    ],
    assembly:function(node)
    {
        var tag = this.tag, dropm = this.menuLayer, data = this.knowledgeBase[tag].list, html = [];
        if(data.length>0){
        
	        html.push ( ' <div class="pop_recomment"> ');
	        	html.push ( '<h3>精选分类</h3>');
	        	html.push ( '<div class="cont"> ');
				    for(var i = 0,len = data.length;i<len;i++)
				    {
				        var temp = data[i];
				        if(temp)
				        html.push('<a href="'+temp[1]+'" >'+temp[0]+'</a>');
				    }
				html.push(' </div>');
				/*
				html.push ( '<h3>精选分类2</h3>');
	        	html.push ( '<div class="cont"> ');
				    for(var i = 0,len = data.length;i<len;i++)
				    {
				        var temp = data[i];
				        if(temp)
				        html.push('<a href="'+temp[1]+'" >'+temp[0]+'</a>');
				    }
				html.push(' </div>');
				*/
	        html.push ( '</div>');

	        node.append(html.join(''));
        }
    },
    getTagByName:function(name)
    {
        if(typeof name !== 'string') return;
        var data = this.knowledgeBase;
        if(data.length>0){
	        var j;
	        for(var i=0,len=data.length;i<len;i++)
	        {
	            var temp = data[i];
	            if(temp.name == name)
	                {
	                    j = i;
	                    break;
	                }
	        }
	        return j;
        }
    },
    init:function() {
        var topThis = this,timer,timespace = 200;
        var lis = $('#list').find('li');
        var classname = 'hover_trigger';
        lis.mouseover(function(){ 
            lis.removeClass(classname);
            var tag = topThis.getTagByName($.trim($(this).text())); 
            if(typeof tag != 'undefined')
            {
                if(!$(this).hasClass('.cont'))
                {
                    topThis.tag = tag;
                    topThis.assembly($(this));
                }
            }
            $(this).addClass(classname);
        }).mouseout(function(){
                $(this).removeClass(classname);
        });
    }
}
dropDownMenu.init();



</script> 
<script>
   ;(function($){
      $('.hot_search li').hover(function(){
      $(this).siblings().removeClass('hover_trigger')
         $(this).addClass('hover_trigger');
      });
      $('.famous_list li,.cate_item,.product_list li').hover(function(){
         $(this).addClass('hover_trigger');
         },function(){
         $(this).removeClass('hover_trigger');
         });
    })(jQuery);

</script>